Crash on "release DB" cause?

I have a script that on occasion will cause a crash:

-R-E- DXL: <\\.../find_CR.dxl:1673> An unexpected error has occurred: doors.exe caused an EXCEPTION_ACCESS_VIOLATION in module doors.exe at 0000000040C15FDF

-R-E- DXL: <\\.../find_CR.dxl:2755> An unexpected error has occurred: doors.exe caused an EXCEPTION_ACCESS_VIOLATION in module doors.exe at 0000000040C15FDF

-I- DXL: execution halted

 

In the below code snippet you see at the end line 1673  - "release dbConfigGUI". 

Any hints at what to check that might cause this?

 

Code Snippet:

    //...
    
        //NOW PROCESS THE MODULES:
        //------------------------
        modulesProcessingStatus=true //set the global modulesProcessingStatus to indicate the ASSUMED result of processing all modules: success.
        string moduleFullName
        bool modProcStatus //status result for processing an individual module
        ModuleVersion modVer
        int keyVal
        for moduleFullName in modulesToProcess do //for each module to be processed...
        {
                modVer=null //use null unless scope is a baseline set, in which case we must process specific baseline versions of the target modules
                //If scope is a baseline set, lets get the ModuleVersion info we need (will be the corresponding entry [i.e. at same key value] in skip list moduleVersionsChosenInBST):
                if (scopeOption==SCOPE_BSTMOD)
                {
                        keyVal=(int key modulesToProcess)
                        if (!find(moduleVersionsChosenInBST,keyVal,modVer) || null modVer) { errorBox "ERROR - couldn't retrieve module version information for module \"" moduleFullName "\"! Aborting."; abortScript() }
                }
                modProcStatus=processModule(moduleFullName,modVer) //process the module, and save the status
                //if we have a status failure for this module, the modulesProcessingStatus global needs to be set to false to correct the above assumption:
                if (!modProcStatus) { modulesProcessingStatus=false }
        }
        processingDone=true     
    progressStop //ALL DONE WITH PROGESS BAR!!
    doingProgressBar=false
    release dbConfigGUI
}//end: void doProcessChosenScope(DB dbConfigGUI)

 

 

Note: In the below code snippet from the main block you see line 2755 near the end - "hide dbConfigGUI". 

 

//BLOCK ON CONFIG GUI UNTIL USER IS DONE CONFIGURATION & EITHER ABORTED (CLOSE BUTTON) OR OPTED TO PROCESS THEIR DESIRED MODULE SCOPE:
//------------------------------------------------------------------------------------------------------------------------------------
doingConfig=true
while (!stopScript && !processingDone)
{
        block(dbConfigGUI) 
}
doingConfig=false
hide dbConfigGUI     
destroy dbConfigGUI
dbConfigGUI=null

 


strathglass - Thu Apr 27 11:43:49 EDT 2017

Re: Crash on "release DB" cause?
Mathias Mamsch - Fri Apr 28 08:12:13 EDT 2017

Hmm these kinds of crashes are hard to debug. I guess you are not using "show" anywhere in your DXL, because show and block do not go easy with each other.

 

That being said, I think you should check the parenting of your dialog. When you parent your dialog to the current Module, once you close the module it will kind of free the dialog causing crashes if you still use it. Therefore make sure your dialog is parented to dbExplorer. 

Apart from that everything looks not too bad. Maybe that helps, Regards, Mathias

Re: Crash on "release DB" cause?
strathglass - Fri Apr 28 13:04:38 EDT 2017

Mathias Mamsch - Fri Apr 28 08:12:13 EDT 2017

Hmm these kinds of crashes are hard to debug. I guess you are not using "show" anywhere in your DXL, because show and block do not go easy with each other.

 

That being said, I think you should check the parenting of your dialog. When you parent your dialog to the current Module, once you close the module it will kind of free the dialog causing crashes if you still use it. Therefore make sure your dialog is parented to dbExplorer. 

Apart from that everything looks not too bad. Maybe that helps, Regards, Mathias

OK, thanks ... wasn't aware that could be a potential issue, and in some instances I may be closing current Module.

So correct me if this is wrong but I assume I can add the second line after the existing first line below:

dbConfigGUI=centred CONFIG_GUI_TITLE //these two variables declared earlier
setParent(dbConfigGUI,dbExplorer) //add this line??

Correct?

Re: Crash on "release DB" cause?
Mathias Mamsch - Sat Apr 29 04:54:50 EDT 2017

strathglass - Fri Apr 28 13:04:38 EDT 2017

OK, thanks ... wasn't aware that could be a potential issue, and in some instances I may be closing current Module.

So correct me if this is wrong but I assume I can add the second line after the existing first line below:

dbConfigGUI=centred CONFIG_GUI_TITLE //these two variables declared earlier
setParent(dbConfigGUI,dbExplorer) //add this line??

Correct?

Thats a possibility. Better yet, created the DB not with "centered" but with 

DB create (DB parent, string title, int options) 

and use the centered style inside the options. Regards, Mathias

Re: Crash on "release DB" cause?
strathglass - Mon May 01 08:09:24 EDT 2017

Mathias Mamsch - Sat Apr 29 04:54:50 EDT 2017

Thats a possibility. Better yet, created the DB not with "centered" but with 

DB create (DB parent, string title, int options) 

and use the centered style inside the options. Regards, Mathias

Got it, thanks...will try this method!